package boot

import (
	"k9-panel/app/adapter/http/middleware"
	"k9-panel/app/permission"
	"k9-panel/app/query"
	"k9-panel/config"
)

type Config struct {
	ConfigFile string
}

func Start(bootConfig Config) {
	cfg, err := config.LoadConfig(bootConfig.ConfigFile)
	gDB := query.Init(cfg)
	_ = permission.Init(gDB)
	middleware.Init(cfg)

	if err != nil {
		panic(err)
	}
}
